import 'package:dmz/base/pageWidget/base_stateful_widget.dart';

import 'package:dmz/base/widget/defult_widget.dart';
import 'package:dmz/business/mine/controller/seting_main_controller.dart';
import 'package:dmz/business/mine/widget/seting_widgets.dart';
import 'package:dmz/utils/keyboard_util.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

class FeedBackPage extends BaseStatefulWidget<SetingMainController> {
  const FeedBackPage({super.key});

  @override
  String titleString() => '意见反馈'.tr;

  @override
  get updateId => 'feedBack';

  @override
  bool delectControll() => false;

  @override
  Widget buildContent(BuildContext context) {
    return Container(
        color: Colors.transparent,
        child: Column(children: [
          SetingWidgets.imageSelectWidget(
              '请提供问题截图'.tr,
              controller.imagesDatas,
              controller.feedbackSelectImages,
              (index) => controller.delectImageIndex(index)),
          inputWidget(),
          const Expanded(child: SizedBox()),
          bottomWidget()
        ])).addGestureDetector(() => KeyboardUtils.hideKeyboardGex());
  }

  inputWidget() {
    return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
      Container(height: 2.sp, color: const Color(0xFFD8D8D8))
          .marginOnly(top: 70.sp, bottom: 70.sp),
      DefaultText('*问题和意见'.tr, 32.sp, textColor: const Color(0xB3FFFFFF))
          .marginOnly(bottom: 54.sp),
      SetingWidgets.inputWidget(controller.setFeedbackCt,
          (value) => controller.feedbackInputChnage()),
      Container(height: 2.sp, color: const Color(0xFFD8D8D8))
          .marginOnly(top: 80.sp),
    ]).marginOnly(left: 32.sp, right: 32.sp);
  }

  bottomWidget() {
    return DefaultBtn(click: () => controller.feedbackUpdata(), title: '提交')
        .marginOnly(bottom: 112.sp);
  }
}
